<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //解构
        const DUIXIANG = ['蒋富涛', '有钱', '有老婆'];
        //数组解构给变量
        let [a, b, c] = DUIXIANG;
        console.log(a);
        console.log(b);
        console.log(c);
        //对象解构给变量
        const ZHANG = {
            name: '张明',
            age: '999',
            kanren: function() {
                console.log('我会砍人');
            }
        }
        let {
            name,
            age,
            kanren
        } = ZHANG;
        console.log(name);
        console.log(age);
        console.log(kanren);
        kanren()



        //解构
        const DUIXIANG = ['蒋富涛', '有钱', '有老婆'];
        //数组解构给变量
        let [a, b, c] = DUIXIANG;
        console.log(a);
        console.log(b);
        console.log(c);
        //对象解构给变量
        const ZHANG = {
            name: '张',
            age: '999',
            kanren: function() {
                console.log('我会砍人');
            }
        }
        let {
            name,
            age,
            kanren
        } = ZHANG;
        console.log(name);
        console.log(age);
        console.log(kanren);
        kanren()




        //解构
        const DUIXIANG = ['蒋富涛', '有钱', '有老婆'];
        //数组解构给变量
        let [a, b, c] = DUIXIANG;
        console.log(a);
        console.log(b);
        console.log(c);
        //对象解构给变量
        const ZHANG = {
            name: '张',
            age: '999',
            kanren: function() {
                console.log('我会砍人');
            }
        }
        let {
            name,
            age,
            kanren
        } = ZHANG;
        console.log(name);
        console.log(age);
        console.log(kanren);
        kanren()
    </script>
</body>

</html>